﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Xiaowei.Services
{
    public interface ITTSPlayer
    {
        /// <summary>
        /// the attribute that indicate the player is play or pause.
        /// </summary>
        bool IsPlaying { get; }
        /// <summary>
        /// the event nodified when IsPlaying changed.
        /// </summary>
        event Action<bool> IsPlayingChanged;
        /// <summary>
        /// Play tts,the task will return after IsPlaying set true or confirm the tts play failed.
        /// </summary>
        /// <param name="url">the tts will played.</param>
        /// <returns>if true,the tts play successed,other will return false.</returns>
        bool Play(string url);
        /// <summary>
        /// Cancel the current tts.
        /// </summary>
        void Cancel();
    }
}
